#!/usr/bin/php
<?php

// set up the Mongodb connection
$mongo = new Mongo();

// the database itself.
$db = $mongo->mugshots;

// the collection (nee table)
$collection = $db->shots;

$query = $argv[1];

$results = $collection->find(array("name" => new MongoRegex("/$query/i")), array("seq" => 1, "name" => 1))->timeOut(90000);

foreach($results as $r)
{
	print_r($r);
}	
